Address Wagtail CSP issues #6052
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mozilla/sumo#1817
Highlights
/cms/login/
), but loosens the policy withunsafe-inline
forscript-src
andstyle-src
for all of the other Wagtail CMS pages (/cms/*
), which are currently restricted to Mozilla LDAP users.unsafe-inline
for all of the non-login Wagtail CMS pages, but that'll require calculating some hashes for scripts that are constant, overriding about 17 other templates (by copying most of their code) and adding anonce
to all of their inline scripts, and that's only what I know so far. There may be more. All of that work is postponed until a later date. Hopefully, Wagtail will resolve more of their CSP issues before we need to tackle that, but I think we'll need to tackle that at the point when we're ready to open the Wagtail CMS to users outside of Mozilla.wagtail.scss
file that's built by our usualwebpack
flow and included in all of the Wagtail CMS pages, so we can add our own CSS as needed.wagtail/admin/templates/wagtailadmin/admin_base.html
withkitsune/sumo/templates/wagtailadmin/admin_base.html
to include anonce
to secure the inline script it contains. It's not clean in the sense that it copies code from Wagtail, but I couldn't see any other way forward.